home *** CD-ROM | disk | FTP | other *** search
- Path: dimensional.com!news
- From: cjames@melchizedek.cec-services.com (The Right Reverend Colin James III)
- Newsgroups: comp.object,comp.lang.c++,comp.lang.java
- Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
- Date: Sat, 23 Mar 1996 13:27:29 GMT
- Organization: CEC Services, LLC
- Message-ID: <3153fbd5.981409992@news.dimensional.com>
- References: <1996Mar14.155641.4299@schbbs.mot.com> <4irn11$7ln@mimas.brunel.ac.uk> <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu> <4j03p4$fbt@hoho.quake.net>
- Reply-To: cjames@melchizedek.cec-services.com
- NNTP-Posting-Host: melchizedek.cec-services.com
- X-Newsreader: Forte Agent .99d/32.182
-
- billf@jovial.com (Bill Foote) posted with deletions:
-
- | In article <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu>,
- | Matthew Travis <mtravis@students.uiuc.edu> wrote:
- | >H'llo,
- | > for clarification, Java uses the same exception handling
- | >mechanism as C++ (with the addition of the finally clause). The two
- | >possible mechanisms are "resumption" and "termination". A quote from the
- | >"Annotated C++ Reference Manual" states:
- | >
- | > "Exception handling is intended to allow code that has encountered
- | >a condition it cannot cope with to return to some other code that
- | >directly or indirectly invoked it. There is no way for an exception
- | >handler to request the thread of control to resume from the throw point.
- | >In other words, "throw" implements the termination model of exception
- | >handling." -ARM, Ellis & Stroustrup, page 354
- | >
- | >This model has been accepted into the draft C++ standard and is also the
- | >model Java uses. The philosophy is that an exception indicates some error
- | >condition that is usually unrecoverable and code that is in error should
- | >terminate (thinking about it logically).
- |
- | A cynic might conclude something more along these lines: "It would be hard
- | to implement resumable exceptions in C++, so they decided to punt."
- |
- | It's not too hard to come up with examples where it would be nice to have
- | resumable exceptions. One example is resource acquisition. Upon failure
- | to acquire a resource (a file descriptor, some memory, etc.) it might be
- | nice if a top-level exception handler could try to free up some resources,
- | and if it can, try to resume from the exception.
- |
- |
- | Oh well.
- | --
- | Bill Foote | L'homme est nΘ pour vivre dans les
- | billf@jovial.com | convulsions de l'inquiΘtude ou dans la
- | http://www.jovial.com/~billf/ | lΘthargie de l'ennui -- Voltaire
-
- Cross-posted to six usenet groups [ in the original ], the above has
- nothing whatsoever to do with Eiffel or comp.lang.eiffel, so remove it
- therefrom now.
-
- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- Colin James III, Principal Scientist cjames@cec-services.com
- CEC Services, 2080 Kipling St, Lakewood, CO 80215-1502 USA
- Voice: 303.231.9437; Facsimile: .231.9438; Data: .231.9434
- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
-